//
//  MBGoodsDetailImageContentView.m
//  MobellCloud_ios
//
//  Created by cherry pu on 2017/12/28.
//  Copyright © 2017年 zhangXin. All rights reserved.
//

#import "MBGoodsDetailImageContentView.h"
#import <WebKit/WebKit.h>

@interface MBGoodsDetailImageContentView()
@property (nonatomic,weak)WKWebView* webView;

@end

@implementation MBGoodsDetailImageContentView

- (instancetype)init
{
    self = [super init];
    if (self) {
        
        [self mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.mas_equalTo(SCREEN_WIDTH);
        }];

        CGFloat height = SCREEN_HEIGHT-44-SCREEN_STATUS_BAR_HEIGHT+1;

        WKWebView* webView = [[WKWebView alloc]init];
        self.webView = webView;
        [self addSubview:webView];
        
        [webView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.bottom.equalTo(self);
            make.left.right.equalTo(self);
            make.height.mas_equalTo(height);
        }];

    }
    return self;
}

#pragma mark - MBGoodsDetailBottomViewDelegate


-(void)setInfoModel:(MBGoodsInfoModel *)infoModel
{
    _infoModel = infoModel;
    
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",BASE_URL,infoModel.goods.goods_content]]]];
    
}

@end
